package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

@Entity
@Table(name = "activity_hold_info")
@JsonApiResource(type = "activityHoldInfo")
public class ActivityHoldInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;
	private String picPath1;
	private String picPath2;
	private String picPath3;
	private String picPath4;
	private String picPath5;

	private Integer createDateTime;
	private Integer holdTime;
	private String title;
	private String discription;
	private String url;

	private ActivityPlan activityPlan;

	@Column(name = "pic_path1")
	public String getPicPath1() {
		return picPath1;
	}

	public void setPicPath1(String picPath1) {
		this.picPath1 = picPath1;
	}

	@Column(name = "pic_path2")
	public String getPicPath2() {
		return picPath2;
	}

	public void setPicPath2(String picPath2) {
		this.picPath2 = picPath2;
	}

	@Column(name = "pic_path3")
	public String getPicPath3() {
		return picPath3;
	}

	public void setPicPath3(String picPath3) {
		this.picPath3 = picPath3;
	}

	@Column(name = "pic_path4")
	public String getPicPath4() {
		return picPath4;
	}

	public void setPicPath4(String picPath4) {
		this.picPath4 = picPath4;
	}

	@Column(name = "pic_path5")
	public String getPicPath5() {
		return picPath5;
	}

	public void setPicPath5(String picPath5) {
		this.picPath5 = picPath5;
	}

	@Column(name = "create_date_time")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "hold_time")
	public Integer getHoldTime() {
		return holdTime;
	}

	public void setHoldTime(Integer holdTime) {
		this.holdTime = holdTime;
	}

	@Column(name = "title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "discription")
	public String getDiscription() {
		return discription;
	}

	public void setDiscription(String discription) {
		this.discription = discription;
	}

	@Override
	@Column(name = "url")
	public String getUrl() {
		return url;
	}

	@Override
	public void setUrl(String url) {
		this.url = url;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "activity_plan_id", foreignKey = @ForeignKey(name = "null"))
	public ActivityPlan getActivityPlan() {
		return activityPlan;
	}

	public void setActivityPlan(ActivityPlan activityPlan) {
		this.activityPlan = activityPlan;
	}
}
